package com.qf.purchase.service;

import com.github.pagehelper.PageInfo;
import com.qf.purchase.dao.PurchaseOrderDetailsDao;
import com.qf.purchase.po.PurchaseOrderDetails;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class PurchaseOrderDetailsServiceImpl implements PurchaseOrderDetailsService{
    @Resource
    private PurchaseOrderDetailsDao purchaseOrderDetailsDao;

    @Override
    public boolean addPurchaseOrderDetails(PurchaseOrderDetails purchaseOrderDetails) {
        return purchaseOrderDetailsDao.addPurchaseOrderDetails(purchaseOrderDetails)>0;
    }

    @Override
    public PageInfo<PurchaseOrderDetails> getPurchaseOrderDetailsByNumber(Map params) {
        List<PurchaseOrderDetails> purchaseOrderList=purchaseOrderDetailsDao.getPurchaseOrderDetailsByNumber(params);
        PageInfo<PurchaseOrderDetails> pageInfo = new PageInfo<PurchaseOrderDetails>(purchaseOrderList);
        return pageInfo;
    }

    @Override
    public boolean updatePurchaseOrderDetails(PurchaseOrderDetails purchaseOrderDetails) {
        return purchaseOrderDetailsDao.updatePurchaseOrderDetails(purchaseOrderDetails)>0;
    }

    @Override
    public boolean delPurchaseOrderDetails(Map params) {
        return purchaseOrderDetailsDao.delPurchaseOrderDetails(params)>0;
    }
}
